﻿Imports System.Data.OleDb

Public Class EditShowreel
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        tb_UserName.Text = User.Identity.Name

        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("3dBuzzDatabase").ConnectionString)
        Dim SqlString As String = "SELECT Video.[VideoId], Video.[Showreel], Video.[ArtistId], Video.[Title], Video.[Description], Video.[OriginalFilename], Artists.[ID], aspnet_Users.[UserName] FROM ([aspnet_Users] INNER JOIN [Artists] ON aspnet_Users.[UserId] = Artists.[ASPUserName]) INNER JOIN Video on Artists.[ID] =Video.[ArtistId] WHERE aspnet_users.UserName = @f1"
        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)
        cmd.CommandType = CommandType.Text
        cmd.Parameters.AddWithValue("@f1", User.Identity.Name)
        oleDbConn.Open()
        'this is the data reader
        Dim dataReader = cmd.ExecuteReader()    'because we are returning results
        GridView1.DataSource = dataReader
        GridView1.DataBind()

 
    End Sub

End Class